/**
 * 文章支持，赞，踩
 */
 function operateClick(type){
	var url = 'public/article/view';
	 var params = {'id':$('#articleId').val(),'type':type};
	 ajaxResult(url,params,function(success,result){
		 if(success){
			 switch(type){
				case 1:
					$(".articleDetail .zhichi span").html("("+result.obj.supportNum+")");
					break;
				case 2:
					$(".articleDetail .fandui span").html("("+result.obj.opposeNum+")");
				break;
				case 3:
					$(".articleDetail .collect span").html("("+result.obj.collectNum+")");
				break;
			}
		}else{
			 if(result.code == 102){
					$.util.login(result.message);
			 }else{
				 $.util.alert(result.message);
			}
		}
	 });
}
	function operateComment(){
		var world = $('#world').html();
		if(!world){
			$('#world').html('');
			$.util.alert('评论不能为空');
			return;
		}
		var url = 'public/article/articleComment';
		 var params = {'articleId':$('#articleId').val(),'commentContent':$(".article-detail-comment .comment-content").html()};
		 ajaxResult(url,params,function(success,result){
			 if(success){
				 $.util.alert(result.message);
				 	var chName = $('#currentChName').val();
					var cLi = "<li><div style=\"float: left;width: 80px;height: 70px;\"><img style=\"border-radius:50%;width: 65px;height: 65px;\" src=\"public/user/showPicture/"+result.obj.userId+"\" /></div><div class=\"pinglun-date\">"+chName+":&nbsp;&nbsp;"+formatDateStyle(result.obj.commentDate)+"</div><div class=\"pinglun-comment\">"+result.obj.commentContent+"</div></li>";
					$(".pinglun-list ul").prepend(cLi);
			 }else{
				 if(result.code == 102){
						$.util.login(result.message);
				}else{
					 	$.util.alert(result.message);
				}
			 }
		 });
	}
			
	function doZoom(size) {
			document.getElementById('zoom').style.fontSize = size+ 'px';
	}
	
	/**
	 * 关注文章作者
	 */
function attentionArticleAuth(){
	var url = 'public/article/attentionArticleAuth';
	var params = {'userId':$('#authId').val()};
	ajaxAsyncResult(url,params,function(success,result){
		if(success){
			$.util.alert(result.message);
		}else{
			if(result.code == 102){
				$.util.login(result.message);
			}else{
				$.util.alert(result.message);
			}
		}
	});
}

/**
 * 发私信
 */
function sendPrivateMsg(){
	var url = 'public/article/sendPrivateMsg';
	var params = {'userId':$('#authId').val()};
	ajaxAsyncResult(url,params,function(success,result){
		if(success){
			window.location.href='user/msg/personalLetter?userId='+$('#authId').val();
		}else{
			$.util.login(result.message);
		}
	});
}

	